<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>构造函数对象</title>
</head>
<body>
    <script>
        let student1 = {
            name:'xixi',
            age:20,
            gender:'男',
            height:'180cm',
            hobby:'dance',
            action:function(){
                speak:chinese
                can:java
            }
        }
        let student2= {
            name:'lili',
            age:22,
            gender:'女',
            height:'160cm',
            hobby:'pingpong',
            action:function(){
                speak:English
                can:web
            }
        }
        function Person(name,age,gender){
            this.name = name;
            this.age = age;
            this.gender = gender;
            this.action=function(){
                console.log(this.name+'，'+'今年'+age+'岁'+'，'+'是'+gender+'孩子')
            }
        }
        let son = new Person('ddi','22','女');
        console.log(son.name);
        son.action()
        let people = new Person(student1);
        // console.log(people)
        
        let subject1 = {
            chinese:89
        }
        let subject2= {
            math:40
        }
        let subject3 = {
            English:70
        };
        function Subject(chinese,math,English){
            this.chinese = chinese;
            this.math = math;
            this.English = English;
            this.num= function(){
                return (this.chinese+this.math+this.English)/3
            }
        };
        let subject = new Subject(20,30,30);
        console.log(Math.floor(subject.num()))
        
    </script>
</body>
</html>